package com.jeesite.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author gzm
 * @description: 分页DTO
 * @date 2019/4/28 14:49
 */
@ApiModel(value = "分页DTO")
public class ParamPageDTO {

  @ApiModelProperty(value = "开始页")
  private Integer pageNo;

  @ApiModelProperty(value = "每页数据")
  private Integer pageSize;

  public ParamPageDTO() {
  }

  public ParamPageDTO(Integer pageNo, Integer pageSize) {
    this.pageNo = pageNo;
    this.pageSize = pageSize;
  }

  public Integer getPageNo() {
    return pageNo;
  }

  public void setPageNo(Integer pageNo) {
    this.pageNo = pageNo;
  }

  public Integer getPageSize() {
    return pageSize;
  }

  public void setPageSize(Integer pageSize) {
    this.pageSize = pageSize;
  }

  /**
   * description: 是否是有效分页信息
   *
   * @param
   * @return boolean
   */
  public boolean isValidPage() {
    return null != pageNo && null != pageSize && pageNo >= 0 && pageSize > 0;
  }

  /**
   * description: 无效分页信息
   *
   * @param
   * @return boolean
   */
  public boolean isNotValidPage() {
    return !isValidPage();
  }
}


